Method and device for feedback control of neural stimulation

ABSTRACT

A method of controlling a neural stimulus by use of feedback. The neural stimulus is applied to a neural pathway in order to give rise to an evoked action potential on the neural pathway. The stimulus is defined by at least one stimulus parameter. A neural compound action potential response evoked by the stimulus is measured. From the measured evoked response a feedback variable is derived. A feedback loop is completed by using the feedback variable to control the at least one stimulus parameter value. The feedback loop adaptively compensates for changes in a gain of the feedback loop caused by electrode movement relative to the neural pathway.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a national stage of Application No.PCT/AU2015/050787, filed Dec. 11, 2015, which application claims thebenefit of Australian Provisional Patent Application No. 2014905031,filed Dec. 11, 2014, the disclosures of which are incorporated herein byreference in their entireties.

TECHNICAL FIELD

The present invention relates to controlling a neural response to astimulus, and in particular relates to measurement of a compound actionpotential by using one or more electrodes implanted proximal to theneural pathway, in order to provide feedback to control subsequentlyapplied stimuli.

BACKGROUND OF THE INVENTION

There are a range of situations in which it is desirable to apply neuralstimuli in order to give rise to a compound action potential (CAP). Forexample, neuromodulation is used to treat a variety of disordersincluding chronic pain, Parkinson's disease, and migraine. Aneuromodulation system applies an electrical pulse to tissue in order togenerate a therapeutic effect. When used to relieve chronic pain, theelectrical pulse is applied to the dorsal column (DC) of the spinalcord. Such a system typically comprises an implanted electrical pulsegenerator, and a power source such as a battery that may be rechargeableby transcutaneous inductive transfer. An electrode array is connected tothe pulse generator, and is positioned in the dorsal epidural spaceabove the dorsal column. An electrical pulse applied to the dorsalcolumn by an electrode causes the depolarisation of neurons, andgeneration of propagating action potentials. The fibres being stimulatedin this way inhibit the transmission of pain from that segment in thespinal cord to the brain. To sustain the pain relief effects, stimuliare applied substantially continuously, for example at a frequency inthe range of 30 Hz-100 Hz.

Neuromodulation may also be used to stimulate efferent fibres, forexample to induce motor functions. In general, the electrical stimulusgenerated in a neuromodulation system triggers a neural action potentialwhich then has either an inhibitory or excitatory effect. Inhibitoryeffects can be used to modulate an undesired process such as thetransmission of pain, or to cause a desired effect such as thecontraction of a muscle.

The action potentials generated among a large number of fibres sum toform a compound action potential (CAP). The CAP is the sum of responsesfrom a large number of single fibre action potentials. The CAP recordedis the result of a large number of different fibres depolarising. Thepropagation velocity is determined largely by the fibre diameter and forlarge myelinated fibres as found in the dorsal root entry zone (DREZ)and nearby dorsal column the velocity can be over 60 ms⁻¹. The CAPgenerated from the firing of a group of similar fibres is measured as apositive peak potential P1, then a negative peak N1, followed by asecond positive peak P2. Depending on the polarity of sense electrodesthe CAP equivalently may present in the measurement with the oppositepolarity, in which case the nomenclature N1-P1-N2 is used. In eithercase this is caused by the region of activation passing the recordingelectrode as the action potentials propagate along the individualfibres. An observed CAP signal will typically have a maximum amplitudein the range of microvolts, whereas a stimulus applied to evoke the CAPis typically several volts.

Conventionally, spinal cord stimulation (SCS) delivers stimulation tothe dorsal column at a fixed current. When a subject moves or changesposture the distance between the spinal cord and the implanted leadvaries, resulting in an increase or decrease in the amount of currentreceived by the dorsal columns. These changes in current result inchanges to recruitment and paresthesia, which can reduce the therapeuticeffect of SCS and can create side effects including over-stimulation.

If a stimulus is of an amplitude and/or peak width and/or has otherparameter settings which put it below the recruitment threshold,delivery of such a stimulus will fail to recruit any neural response.Thus, for effective and comfortable operation, it is necessary tomaintain stimuli amplitude or delivered charge above the recruitmentthreshold. It is also necessary to apply stimuli which are below acomfort threshold, above which uncomfortable or painful percepts arisedue to increasing recruitment of Aδ fibres which are thinly myelinatedsensory nerve fibres associated with joint position, cold and pressuresensation. In almost all neuromodulation applications, a single class offibre response is desired, but the stimulus waveforms employed canrecruit action potentials on other classes of fibres which causeunwanted side effects, such as muscle contraction if motor fibres arerecruited. The task of maintaining appropriate stimulus amplitude ismade more difficult by electrode migration and/or postural changes ofthe implant recipient, either of which can significantly alter theneural recruitment arising from a given stimulus, depending on whetherthe stimulus is applied before or after the change in electrode positionor user posture. Postural changes alone can cause a comfortable andeffective stimulus regime to become either ineffectual or painful.

Another control problem, facing neuromodulation systems of all types, isachieving neural recruitment at a sufficient level required fortherapeutic effect, but at minimal expenditure of energy. The powerconsumption of the stimulation paradigm has a direct effect on batteryrequirements which in turn affects the device's physical size andlifetime. For rechargeable systems, increased power consumption resultsin more frequent charging and, given that batteries only permit alimited number of charging cycles, ultimately this reduces the implantedlifetime of the device.

Any discussion of documents, acts, materials, devices, articles or thelike which has been included in the present specification is solely forthe purpose of providing a context for the present invention. It is notto be taken as an admission that any or all of these matters form partof the prior art base or were common general knowledge in the fieldrelevant to the present invention as it existed before the priority dateof each claim of this application.

Throughout this specification the word “comprise”, or variations such as“comprises” or “comprising”, will be understood to imply the inclusionof a stated element, integer or step, or group of elements, integers orsteps, but not the exclusion of any other element, integer or step, orgroup of elements, integers or steps.

In this specification, a statement that an element may be “at least oneof” a list of options is to be understood that the element may be anyone of the listed options, or may be any combination of two or more ofthe listed options.

SUMMARY OF THE INVENTION

According to a first aspect the present invention provides an automatedmethod of controlling a neural stimulus, the method comprising:

applying the neural stimulus to a neural pathway in order to give riseto an evoked action potential on the neural pathway, the stimulus beingdefined by at least one stimulus parameter;

measuring a neural compound action potential response evoked by thestimulus, and deriving from the measured evoked response a feedbackvariable;

completing a feedback loop by using the feedback variable to control theat least one stimulus parameter value; and

adaptively compensating for changes in a gain of the feedback loopcaused by electrode movement relative to the neural pathway.

According to a second aspect the present invention provides animplantable device for controllably applying a neural stimulus, thedevice comprising:

a plurality of electrodes including one or more nominal stimuluselectrodes and one or more nominal sense electrodes;

a stimulus source for providing a stimulus to be delivered from the oneor more stimulus electrodes to a neural pathway in order to give rise toan evoked action potential on the neural pathway;

measurement circuitry for recording a neural compound action potentialsignal sensed at the one or more sense electrodes; and

a control unit configured to:

-   -   control application of a neural stimulus as defined by at least        one stimulus parameter;    -   measure via the measurement circuitry a neural compound action        potential response evoked by the stimulus;    -   determine from the measured evoked response a feedback variable;    -   complete a feedback loop by using the feedback variable to        control the at least one stimulus parameter value; and    -   adaptively compensate for changes in a gain of the feedback loop        caused by electrode movement relative to the neural pathway.

According to a third aspect the present invention provides anon-transitory computer readable medium for controllably applying aneural stimulus, comprising the following instructions for execution byone or more processors:

computer program code means for applying the neural stimulus to a neuralpathway in order to give rise to an evoked action potential on theneural pathway, the stimulus being applied as defined by at least onestimulus parameter;

computer program code means for measuring a neural compound actionpotential response evoked by the stimulus and deriving from the measuredevoked response a feedback variable;

computer program code means for completing a feedback loop by using thefeedback variable to control the at least one stimulus parameter value;and

computer program code means for adaptively compensating for changes in again of the feedback loop caused by electrode movement relative to theneural pathway.

The present invention recognises that (i) recruitment of evoked compoundaction potentials upon the neural pathway by a given stimulus will varybased on the distance of the stimulus electrode(s) from the neuralpathway, and (ii) the observed amplitude of a given ECAP upon the neuralpathway will vary based on the distance of the sense electrode(s) fromthe neural pathway, so that electrode movement as may be caused bypatient movement, postural changes, heartbeat or the like will affectthe feedback loop gain of a system using feedback control of thestimulus.

In some embodiments of the invention, adaptively compensating forchanges in the feedback loop may comprise maintaining a corner frequencyof the feedback loop at a desired value or within a desired range. Forexample the desired value or range of the corner frequency may beselected to suitably attenuate low frequency noise such as heartbeat aswell as high frequency noise such as electrical amplifier noise.Moreover, in some embodiments, the desired value or range of the cornerfrequency may be selected to bias attenuation of heartbeat and noisewhile the recipient is in a more or most sensitive posture, as comparedto when the recipient is in a less sensitive posture, sensitive posturesbeing those with a steeper slope of an ECAP growth curve.

In some embodiments of the invention the feedback loop could be a firstorder feedback loop. Alternatively, the feedback loop could be a secondorder feedback loop, or higher order feedback loop.

In some embodiments the feedback loop is further configured toadaptively compensate for electrical noise, such as amplifier noise, EMGnoise, and neural activity not evoked by the implant.

Some embodiments of the present invention recognise that a slope P ofthe ECAP growth curve varies with the distance d of the electrode arrayfrom the nerve fibre or fibres, so that P is some function of d. Suchembodiments of the present invention also recognise that the stimulusthreshold T, being the minimum stimulus current at which a neuralresponse will be evoked, also varies with d, so that T is some functionof d.

In such embodiments, the slope P can be expressed as a function of T.While d is difficult to determine precisely and is thus often anunknown, T and P can be regularly or substantially continuously measuredor estimated by applying stimuli of varying amplitude to explore theslope P of the ECAP amplitude growth and determine a zero intercept,i.e., the threshold T, at any given time.

In some such embodiments, an estimation unit may be provided whichproduces an estimate P′ of the slope P. The estimation P′ may in someembodiments be produced by the estimation unit from an empiricalrelationship of stimulus current to measured ECAP amplitude, and forexample may be estimated as P′=(V+K)/I, where V is ECAP amplitude, K isa constant or function which relates P to a stimulus threshold T, forexample K=P.T, and I is stimulus current amplitude. In such embodiments,the estimate P′ may then be introduced into the feedback loop tocounteract the effect of P. For example, an error signal of the feedbackloop may be scaled by 1/P′.

The feedback variable could in some embodiments be any one of: anamplitude; an energy; a power; an integral; a signal strength; or aderivative, of any one of: the whole evoked compound action potential;the fast neural response for example in the measurement window 0-2 msafter stimulus; the slow neural response for example in the measurementwindow 2-6 ms after stimulus; or of a filtered version of the response.The feedback variable could in some embodiments be an average of anysuch variable determined over multiple stimulus/measurement cycles. Thefeedback variable may in some embodiments be the zero intercept, or theslope, of a linear portion of the response of Aβ amplitude to varyingstimulus current. In some embodiments the feedback variable may bederived from more than one of the preceding measures.

The control variable, or stimulus parameter, could in some embodimentsbe one or more of the total stimulus charge, stimulus current, pulseamplitude, phase duration, interphase gap duration or pulse shape, or acombination of these.

The present invention thus recognises that using a feedback loop tomaintain a constant ECAP is a difficult task as changes in patientposture both create signal inputs and change the loop characteristics.Choosing an optimum corner frequency for the loop is a tradeoff betweenobtaining optimum noise rejection and optimum loop speed. This tradeoffis made more challenging with variations in loop gain.

The set point of the feedback loop may be configured so as to seek aconstant value of ECAP amplitude, or may be configured to seek a targetECAP amplitude which changes over time, for example as defined by atherapy map as described in International Patent Application PublicationNo. WO2012155188 by the present applicant, the content of which isincorporated herein by reference.

BRIEF DESCRIPTION OF THE DRAWINGS

An example of the invention will now be described with reference to theaccompanying drawings, in which:

FIG. 1 schematically illustrates an implanted spinal cord stimulator;

FIG. 2 is a block diagram of the implanted neurostimulator;

FIG. 3 is a schematic illustrating interaction of the implantedstimulator with a nerve;

FIG. 4 is a system schematic illustrating elements and inputs of afeedback loop involving the device of FIG. 3, for maintaining neuralrecruitment at a desired level or upon a desired locus;

FIG. 5 conceptually illustrates signal interaction in the system ofFIGS. 3 and 4;

FIG. 6 illustrates the variation in the slope of the growth curve of theECAP response amplitude, with changing posture;

FIG. 7 is a continuous time representation of a first order feedbackloop in accordance with one embodiment of the present invention;

FIG. 8 illustrates the loop of FIG. 7 with simple inputs;

FIG. 9 is a signal flow graph of the continuous time loop with simpleinputs of FIG. 8;

FIG. 10 is a Bode plot of the transfer function of the loop of FIGS.8-9;

FIG. 11 illustrates variations in attenuation of low frequency heartbeatand high frequency noise, respectively, by the continuous time loop ofFIG. 8, in response to changes in recipient posture;

FIG. 12 illustrates variations in attenuation of low frequency heartbeatand high frequency noise, respectively, by a discrete time or sampleddata loop equivalent to the continuous time loop of FIG. 8, in responseto changes in recipient posture;

FIG. 13 illustrates variations in attenuation of low frequency heartbeatand high frequency noise, respectively, by a second-order sampled dataloop, in response to changes in recipient posture;

FIG. 14 illustrates a continuous time model of the second order loopreflected in FIG. 13;

FIG. 15 illustrates the a second order controller in the z-domain,equivalent to the continuous time model of FIG. 14;

FIG. 16 illustrates a feedback loop comprising P estimation inaccordance with another embodiment of the present invention;

FIG. 17a is a graph showing ECAP amplitude over time during changes inrecipient posture, without feedback control, while FIG. 17b is a graphshowing ECAP amplitude over time during changes in recipient posture,with feedback active;

FIG. 18 shows RMS variation of the response from the comfort level;

FIG. 19 shows the comparison of user perception between feedback andnon-feedback;

FIG. 20 shows a user's perception of paraesthesia continuity acrossvarious postures; and

FIG. 21 illustrates perceived paraesthesia variation ratings acrosspostures.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 schematically illustrates an implanted spinal cord stimulator100. Stimulator 100 comprises an electronics module 110 implanted at asuitable location in the patient's lower abdominal area or posteriorsuperior gluteal region, and an electrode assembly 150 implanted withinthe epidural space and connected to the module 110 by a suitable lead.

FIG. 2 is a block diagram of the implanted neurostimulator 100. Module110 contains a battery 112 and a telemetry module 114. In embodiments ofthe present invention, any suitable type of transcutaneouscommunication, such as infrared (IR), electromagnetic, capacitive andinductive transfer, may be used by telemetry module 114 to transferpower and/or data between an external device and the electronics module110.

Module controller 116 has an associated memory 118 storing patientsettings 120, control programs 122 and the like. Controller 116 controlsa pulse generator 124 to generate stimuli in the form of current pulsesin accordance with the patient settings 120 and control programs 122.Electrode selection module 126 switches the generated pulses to theappropriate electrode(s) of electrode array 150, for delivery of thecurrent pulse to the tissue surrounding the selected electrode.Measurement circuitry 128 is configured to capture measurements ofneural responses sensed at sense electrode(s) of the electrode array asselected by electrode selection module 126.

FIG. 3 is a schematic illustrating interaction of the implantedstimulator 100 with a nerve 180, in this case the spinal cord howeveralternative embodiments may be positioned adjacent any desired neuraltissue including a peripheral nerve, visceral nerve, parasympatheticnerve or a brain structure. Electrode selection module 126 selects astimulation electrode 2 of electrode array 150 to deliver an electricalcurrent pulse to surrounding tissue including nerve 180, and alsoselects a return electrode 4 of the array 150 for stimulus currentrecovery to maintain a zero net charge transfer.

Delivery of an appropriate stimulus to the nerve 180 evokes a neuralresponse comprising a compound action potential which will propagatealong the nerve 180 as illustrated, for therapeutic purposes which inthe case of spinal cord stimulator for chronic pain might be to createparaesthesia at a desired location.

The device 100 is further configured to sense the existence andintensity of compound action potentials (CAPs) propagating along nerve180, whether such CAPs are evoked by the stimulus from electrodes 2 and4, or otherwise evoked. To this end, any electrodes of the array 150 maybe selected by the electrode selection module 126 to serve asmeasurement electrode 6 and measurement reference electrode 8. Signalssensed by the measurement electrodes 6 and 8 are passed to measurementcircuitry 128, which for example may operate in accordance with theteachings of International Patent Application Publication No.WO2012155183 by the present applicant, the content of which isincorporated herein by reference.

Described below are a number of embodiments of the present invention foroptimizing the tradeoff between noise and loop response in the presenceof variations in loop gain due to mechanical changes in theelectrode-to-nerve distance d.

Referring to FIG. 4, the feedback loop 400 comprises stimulator A whichtakes a stimulation current value and converts it into a stimulationpattern defining a pulse width, number of electrodes and the like, toproduce an electrical pulse on the stimulation electrodes 2 and 4. Inthis embodiment the stimulus parameters are: alternating phase on/off,number of phases, number of stimulus electrode poles (bipolar, tripolaretc), pulse width, stimulus position, stimulus to measurement distance,stimulus rate. The stimulation output by stimulator A thus has a summaryvalue m, usually the pulse amplitude, which is controlled by thefeedback loop 400.

The stimulus crosses from the electrodes 2,4 to the spinal cord 180.However the neural recruitment arising from this is affected bymechanical changes in d, including posture changes, walking, breathing,heartbeat and so on. The stimulus also generates an evoked response ywhich may be approximated by the equation y=P(m−T) where T is thestimulus threshold and P is the slope of the response function. Varioussources of noise n add to the evoked response y before it is measured,including (a) artifact, which is dependent on both stimulus current andposture; (b) electrical noise from external sources such as 50 Hz mainspower; (c) electrical disturbances produced by the body such as neuralresponses evoked not by the device but by other causes such asperipheral sensory input, ECG, EMG; and (d) electrical noise fromamplifiers 128. FIG. 5 conceptually illustrates signal interaction inthe system.

The evoked response is amplified in the hardware sensor H then detectedby the detector F. The measured evoked response amplitude f is then usedas the feedback term for the loop 400, being compared to the setpoint sto produce an error e which is fed to the loop controller E. Thefeedback term can only be provided to the next stimulus, so there is anet delay of one sample round the loop.

Two clocks (not shown) are used in this embodiment, being a stimulusclock operating at ˜60 Hz and a sample clock for measuring the evokedresponse y operating at ˜10 KHz. As the detector is linear, only thestimulus clock affects the dynamics of the feedback loop 400.

The ECAP amplitude f can be used in feedback loop 400 to maintainconstant paraesthesia and/or to maintain ECAP amplitude upon apredefined locus configured to allow subjects to receive consistentcomfortable stimulation in every posture.

FIG. 6 illustrates the variation in the slope of the growth curve of theECAP response amplitude, with changing posture. While only threepostures are shown in FIG. 6, the ECAP growth curve for any givenposture can lie between or outside the curves shown, on a continuouslyvarying basis depending on posture, with the curve moving atunpredictable times whenever the patient moves or changes posture.Notably, the growth curve changes with posture in a manner whereby thestimulus threshold current changes, as indicated at Threshold 1,Threshold 2, Threshold 3 in FIG. 6, but the slope of the growth curvealso changes, as indicated by Slope 1, Slope 2, Slope 3 in FIG. 6. Thepresent invention recognises that at a posture producing a smallthreshold stimulus current, the growth curve slope will be larger(steeper) while at a posture producing a larger threshold stimuluscurrent, the growth curve slope will be smaller. Thus, the growth curveslope P reduces as threshold T increases. One assumption can be thatP=K/T where K is some constant.

In a first embodiment a first order loop transfer function can beformulated in order to provide suitable feedback control in thisscenario. FIG. 7 shows the first level of simplification of the loopwith a first-order controller. For the purposes of analysis andsimulation, there are three inputs: 1 The set point c. Once set, this isleft at a single value for long periods. 2. Changes in mechanical statev. This signal input models posture change, heartbeat, breathing etc.Most of these signals have primary components below 2 Hz. 3. Noise n.This consists mainly of amplifier noise, EMG and non-evoked responses.

The requirements of the loop can be summarized as: 1. The gain from c toy must be 1 at DC, i.e. the loop should target its set-point. 2.Minimize y/v. i.e. keep y constant in the presence of mechanicalvariations. 3. Minimize n/v. i.e. keep the ECAP constant in the presenceof electrical noise. For this analysis, artifact is ignored.

The description starts using Laplace transforms as it is easier topredict the behaviour, though the various implementations use the Ztransform. FIG. 7 shows a first order loop. The term “G” is a simpleconstant multiplier. As can be seen,Y=P(d)(m−T(d))

The present invention recognises that a perturbation via the input vinjects a signal. The injected signal can be estimated from thedifferential:

$\frac{dy}{dd} = {{\frac{dP}{dd}( {m - T} )} + {P\frac{dT}{dd}}}$

Even though d is unknown this equation is enlightening as, when (m−T)>0both changes in P and changes in T create an apparent input signal atthe patient transfer element.

The present invention recognises that a perturbation via the input v,i.e. the changes in P, also affect the loop in a second way, by changingthe loop gain.

For the remainder of this analysis the inputs via the patient transferelement are treated from the point of view of the two separate effects:the input v, which directly affects the output, and the input P, whichaffects the loop gain but does not form a signal input. FIG. 8illustrates the continuous time loop with such simplified inputs. FIG. 9is a signal flow graph of the continuous time loop with simple inputs.

For this analysis, assume A=1, so the transfer function between thetarget and the ECAP is given by:

$\frac{y}{c} = \frac{PG}{s + {PG}}$

And the transfer function between the noise and the ECAP is given by:

$\frac{y}{v} = \frac{PGs}{s + {PG}}$

The transfer function can be shown as the Bode plot of FIG. 10, whichgives the frequency response specifications. The heartbeat contributionis attenuated by:y/v=f _(H) /f _(C)

The noise from the amplifier and from non-evoked responses is assumed tobe white and is attenuated by:y/n=f _(C) /f _(N)

Configuring the loop to have a corner frequency between f_(C) and f_(N)thus attenuates both noise and heartbeat. The loop is adjusted to have a3 Hz corner frequency at the most sensitive posture, which typically iswhen the patient is lying supine. At a sample rate of 60 Hz, thisprovides around 11 dB of noise and movement attenuation at the heartbeatfrequency of one beat per second.

FIG. 11 shows the effect of changes in P upon attenuation of noise(1102) and heartbeat attenuation of heartbeat (1104), by the first ordercontinuous time (Laplace) loop. As the patient changes posture, Pchanges, and with it the loop corner frequency. This change in noiseattenuation is offset by the change in movement attenuation as shown inFIG. 11.

Since P can vary by as much as 10:1, the corner frequency can vary by asimilar amount, around 10:1. If P falls sufficiently, a point is reachedwhere the heartbeat is not attenuated. If P rises sufficiently, itreaches a point where noise is not attenuated.

Thus, in this embodiment a fitting procedure to fit the operation of thedevice 100 to the recipient involves choosing the loop corner frequencyat the middle of the range of P values shown in FIG. 11. Since this isaffecting a filter characteristic, taking the middle of the range as thegeometric mean is preferable to the arithmetic mean.

The loop of FIGS. 7-11 uses continuous time to aid explanation, howeverthe actual loop, being of a nature which delivers pulsatile stimulisampled at 10 kHz, involves sampled data. FIG. 12 shows the frequencycharacteristics of an equivalent sampled data first order loop. In FIG.12 the more sensitive postures with larger P, such as the recipientlying supine, occur on the right of the plot where log(P)>0. If the loopcorner frequency were to be set while the patient was in the leastsensitive posture, such as while lying prone, then movement of theperson to other postures will move the loop characteristics to the rightin FIG. 12, leading to attenuation of noise, and then even amplificationof noise noting that curve 1202 is greater than 0 for log(P)>˜0.5. Suchnoise amplification has indeed been observed. Accordingly preferredembodiments fit the device while the recipient is in the most sensitiveposture, lying supine. Consequently, as the person moves the loopcharacteristics move to the left, which results in a reduction inheartbeat attenuation.

In another embodiment, the loop gain may be set while the recipient isin the most sensitive posture, but biased somewhat to the right in FIG.12 as indicated by 1206 to take more advantage of the central portion1208 of the response where both heartbeat and noise attenuation are low.

The present invention further recognises that a figure of merit for suchfeedback loops can be defined, by referring to FIG. 11: Figure ofMerit=heartbeat attenuation+noise attenuation, at P=1. This sum remainssubstantially constant for small variations in posture either side ofP=1.

FIG. 13 shows the performance of a second-order sampled data loop. Table1 compares the performance of the first-order continuous, first-orderdiscrete and second order discrete loops, showing that the second orderloop performs 3.1 dB better than the first order discrete loop.

TABLE 1 Comparison of loop characteristics Improvement compared toFigure of 1^(st) Order Loop Noise Movement Merit (dB) Discrete FilterName First order 11.5 9.4 20.9 N/A sfilterx1 continuous First order 9.89.3 19.1 0 zfilterx0 discrete Second order 11.0 11.8 22.8 3.7 zfilterx8discrete

Both the first order and second order sampled data loops amplify noisefor P>sqrt(10). The first order loop becomes unstable at P>˜5. Thesecond order loop is unstable at P>sqrt(10).

The details of implementation of an embodiment comprising a second orderloop are now described. In this embodiment a second order filter isdesigned in the s-domain to aid understanding, then transferred to thez-domain for implementation. FIG. 14 illustrates a continuous time modelof the second order loop. This loop of FIG. 14 is used in place of thatin FIG. 9, in this embodiment. Its transfer function from noise tooutput is:

$\frac{y}{n} = \frac{PG}{s^{2} - {as} + {PG}}$

The gain from the patient disturbance to the ECAP:

$\frac{y}{v} = \frac{{PGs}( {s - a} )}{s^{2} - {as} + {PG}}$

These are a low-pass and high-pass response respectively. Consideringthe equation for a second order filter:

${{Gain}\mspace{11mu}({lpf})} = \frac{1}{s^{2} - {\omega_{B}s} + \omega_{0}^{2}}$the corner (resonant) frequency is ω₀=2πf₀ (in radians per second orHz), so comparing to the equation for the gain from patient disturbanceto ECAP, This is critically damped when ω_(B)=1.414 ω₀. So given P, wecan choose G such that:

$G = \frac{( {2\pi\; f_{0}} )^{2}}{P}$ and$a = {2{\sqrt{2} \cdot \pi \cdot f_{0}}}$

The loop was then transformed to the sampled data domain using thebilinear transform to implement each integrator. The bilinear transformapproximates a continuous time integrator in the z-domain using thefollowing transfer function, where T is the sample interval.

$\frac{1}{s} = {\frac{T}{2}\frac{z + 1}{z - 1}}$

FIG. 15 illustrates the equivalent second order controller in thez-domain.

Some embodiments may further provide for estimation and compensation forP, as follows. This method estimates P and then using the estimate (P′)adjusts the loop gain as shown in FIG. 16. The estimator uses thecurrent value and the measured ECAP amplitude. The method of solving theproblem is easier to explain noting that the control variable x is thestimulus current I and the feedback variable f is the measured ECAPvoltage V.

The compensation 1/P′ is added to the loop at a point where the averagesignal is zero, so as to perturb the loop as little as possible.

Since both P and T vary with distance to the cord, there must exist arelationship between them. The initial estimation of P uses theempirical relationship, for some K: PT=K. Taking the model of thecurrent growth curve:V=P(I−T)eliminating T and inverting, gives the estimate P′:

$P = \frac{V + K}{I}$

To give examples of the method for estimation of K, consider the threepatients shown in the following tables.

TABLE 2 patient parameters Posture 1 (most sensitive) Posture 2 (leastsensitive) Threshold Comfort Threshold Comfort Patient SensitivityCurrent Current Sensitivity Current Current Variation I.D. (μV/mA) (mA)(mA) (μv/mA): (mA) (mA) in P A 77 0.8 1 26 3.7 4.5 2.96 B 30 2.7 4.3 202.9 3.7 1.50 C 22 4.5 10.6 19 6.1 12.6 1.16

TABLE 3 average values of TP TP Most TP Least Sensitive SensitiveAverage (TP) 61.6 96.2 78.9 81 58 69.5 99 115.9 107.45

TABLE 4 P′ estimations of P P′ Most P′ Least Sensitive Sensitive ComfortMax Comfort Max 94.30 90.31 22.16 22.40 27.33 27.60 23.11 22.88 22.8022.70 18.33 18.40

TABLE 5 variation in P/P′ P/P′ Most P/P′ Least Variation in SensitiveSensitive P/P′ 1.22 1.17 0.85 0.86 1.44 0.91 0.92 1.16 1.14 0.80 1.041.03 0.96 0.97 1.07

Thus, tables 2 to 5 show that the P estimator halves the variation inloop gain with P.

The present invention thus recognises that a system using a feedbackloop to maintain a constant ECAP is unusual in that the changes inpatient posture create both signal inputs and change the loopcharacteristics. Choosing an optimum corner frequency for the loop is atradeoff between obtaining optimum noise rejection and optimum loopspeed. This tradeoff is made more challenging with variations in loopgain. Methods have been described above that reduce the extent to whichloop gain changes with patient posture, allowing for optimum placementof the loop poles. These methods can be used independently or inconjunction.

A study was conducted to examine the effect of posture changes on painand on side effects (e.g. over-stimulation and under-stimulation),comparing the use of SCS with feedback (automatic current adjustment)against SCS without feedback (conventional fixed current stimulation).Subjects (n=8) were tested with and without feedback control using theSaluda Medical SCS system on the last day of their commercial systemtrial (5 to 7 days after lead implantation).

With feedback, stimulation current was adjusted automatically by theSaluda system by maintaining the ECAP at the subject's comfort level.Without feedback, the device delivered a fixed current similar to thecommercial devices. SCS control with and without feedback were tested invarious postures. Subjects compared the strength of the paraesthesia ateach posture to the previous posture with 5-point Likert scales.

Subject pain scores, and stimulation side effects were compared betweentrial stimulation with the commercial device and Saluda feedbackstimulation using 5-point Likert scales.

FIGS. 17a and 17b are graphs showing the observed amplitude of the ECAPin response to the delivery of stimuli over the course of two minutes,during which time the patient changed posture and made movements asindicated. In FIG. 17a , without feedback loop control, it can be seenthat a regime of stimuli delivered at a constant amplitude produce ECAPswhich vary considerably in amplitude, between zero and 750 uV. Inparticular, it is noted that this patient received no pain relief whenthe ECAP amplitude was below therapeutic threshold 1702, so that it canbe seen from FIG. 17a that the constant stimulus therapy was mostlyfailing to deliver pain relief while the patient was standing or lyingprone. On the other hand, the comfort threshold 1704 for this patientwas also regularly exceeded by the observed ECAP amplitude, inparticular at times when the patient was positioning to stand, brieflywhile prone, during a cough and while taking a deep breath, andrepeatedly while walking.

In contrast, in FIG. 17b when ECAPs were recorded with the feedback loopactively controlling the amplitude of the applied stimuli, and while thepatient repeated the same sequence of actions, the ECAP amplitudes arekept almost entirely within the therapeutic window, above therapeuticthreshold 1702 and below comfort threshold 1704. The occurrence ofevoked responses in the overstimulation region above threshold 1704 hasbeen eliminated entirely, while the occurrence of non-therapeuticresponses having an amplitude below threshold 1702 has beensignificantly reduced compared to FIG. 17 a.

Data of the type shown in FIGS. 17a and 17b , from seven subjects, wasprocessed to determine the variation of the ECAP response from thecomfort level, calculated as root mean square (rms) and shown in FIG.18. The rightmost columns of FIG. 18 show that on average amongst theseseven subjects there was 30% variation from the comfort level whenfeedback was enabled, but more than 70% variation from the comfort levelwithout feedback.

FIG. 19 shows a subjective comparison between feedback and non-feedback.This shows that with feedback, 90% of the subjects have improved painrelief (and no worse side effects) or less side effects (and no worsepain relief).

FIG. 20 illustrates subjective data obtained from one patient showingthat, as is desirable, the paraesthesia strength has much less variationin every movement or change of posture tested when feedback is enabled,as compared to without feedback.

In FIG. 21 the variation in paraesthesia strength across postures wasrated from 0% (no change for any posture) to 100% (much stronger or muchweaker at each posture). With feedback the perceived variation inparaesthesia strength was significantly (P<0.001) reduced, by 30% ascompared to without feedback.

The study of FIGS. 17-21 thus shows that there is a clear correlationbetween the variation of the response with feedback compared tonon-feedback, both when determined directly from measured spinal cordpotentials and when determined from the qualitative assessment of thesubjects. 87% of the subjects had less side effects with either nodifference in pain relief or better pain relief with feedback control,compared with conventional stimulation.

The described electronic functionality can be implemented by discretecomponents mounted on a printed circuit board, or by a combination ofintegrated circuits, or by an application-specific integrated circuit(ASIC).

It will be appreciated by persons skilled in the art that numerousvariations and/or modifications may be made to the invention as shown inthe specific embodiments without departing from the spirit or scope ofthe invention as broadly described. The present embodiments are,therefore, to be considered in all respects as illustrative and notlimiting or restrictive.

The invention claimed is:
 1. A method of controlling a neural stimulus,the method comprising: applying the neural stimulus to a neural pathwayin order to give rise to an evoked action potential on the neuralpathway, the stimulus being defined by at least one stimulus parameter;measuring a neural compound action potential response evoked by thestimulus, and deriving from the measured evoked response a feedbackvariable; completing a feedback loop by using the feedback variable tocontrol the at least one stimulus parameter value; and adaptivelycompensating for changes in a gain of the feedback loop caused byelectrode movement relative to the neural pathway, wherein adaptivelycompensating for changes in the feedback loop comprises maintaining acorner frequency of the feedback loop at a desired value or within adesired range; and wherein the desired value or range of the cornerfrequency is selected to suitably attenuate low frequency noise such asheartbeat as well as high frequency noise such as electrical amplifiernoise.
 2. A method of controlling a neural stimulus, the methodcomprising: applying the neural stimulus to a neural pathway in order togive rise to an evoked action potential on the neural pathway, thestimulus being defined by at least one stimulus parameter; measuring aneural compound action potential response evoked by the stimulus, andderiving from the measured evoked response a feedback variable;completing a feedback loop by using the feedback variable to control theat least one stimulus parameter value; and adaptively compensating forchanges in a gain of the feedback loop caused by electrode movementrelative to the neural pathway, wherein adaptively compensating forchanges in the feedback loop comprises maintaining a corner frequency ofthe feedback loop at a desired value or within a desired range; andwherein the desired value or range of the corner frequency is selectedto bias attenuation of heartbeat and noise while the recipient is in amore or most sensitive posture.
 3. The method of claim 1 wherein thefeedback loop is a first order feedback loop.
 4. The method of claim 1wherein the feedback loop is a second order feedback loop.
 5. The methodof claim 1 further comprising determining an estimate P′ of a slope P ofa current ECAP growth curve.
 6. The method of claim 5 wherein theestimation P′ is produced from an empirical relationship of stimuluscurrent to measured ECAP amplitude.
 7. The method of claim 5 wherein theestimation P′ is estimated as P′=(V+K)/I, where V is ECAP amplitude, Kis a constant or function which relates P to a stimulus threshold T, andI is stimulus current amplitude.
 8. The method of claim 5 wherein theestimate P′ is introduced into the feedback loop to counteract theeffect of P.
 9. The method of claim 8 wherein an error signal of thefeedback loop is scaled by 1/P′.
 10. The method of claim 1 wherein thefeedback variable is an amplitude measure of the evoked compound actionpotential.
 11. The method of claim 1 wherein the stimulus parameter isstimulus current.
 12. The method of claim 1 wherein the set point of thefeedback loop is configured so as to seek a constant value of ECAPamplitude.
 13. The method of claim 1 wherein the set point of thefeedback loop is configured so as to seek a target ECAP amplitude whichchanges over time as defined by a therapy map.
 14. An implantable devicefor controllably applying a neural stimulus, the device comprising: aplurality of electrodes including one or more nominal stimuluselectrodes and one or more nominal sense electrodes; a stimulus sourcefor providing a stimulus to be delivered from the one or more stimuluselectrodes to a neural pathway in order to give rise to an evoked actionpotential on the neural pathway; measurement circuitry for recording aneural compound action potential signal sensed at the one or more senseelectrodes; and a control unit configured to: control application of aneural stimulus as defined by at least one stimulus parameter; measurevia the measurement circuitry a neural compound action potentialresponse evoked by the stimulus; determine from the measured evokedresponse a feedback variable; complete a feedback loop by using thefeedback variable to control the at least one stimulus parameter value;and adaptively compensate for changes in a gain of the feedback loopcaused by electrode movement relative to the neural pathway, bymaintaining a corner frequency of the feedback loop at a desired valueor within a desired range, and wherein the desired value or range of thecorner frequency is selected to suitably attenuate low frequency noisesuch as heartbeat as well as high frequency noise such as electricalamplifier noise.
 15. A non-transitory computer readable medium forcontrollably applying a neural stimulus, comprising the followinginstructions for execution by one or more processors: computer programcode means for applying the neural stimulus to a neural pathway in orderto give rise to an evoked action potential on the neural pathway, thestimulus being applied as defined by at least one stimulus parameter;computer program code means for measuring a neural compound actionpotential response evoked by the stimulus and deriving from the measuredevoked response a feedback variable; computer program code means forcompleting a feedback loop by using the feedback variable to control theat least one stimulus parameter value; and computer program code meansfor adaptively compensating for changes in a gain of the feedback loopcaused by electrode movement relative to the neural pathway, bymaintaining a corner frequency of the feedback loop at a desired valueor within a desired range, and wherein the desired value or range of thecorner frequency is selected to suitably attenuate low frequency noisesuch as heartbeat as well as high frequency noise such as electricalamplifier noise.
 16. The implantable device of claim 14 wherein thefeedback loop is a first order feedback loop.
 17. The implantable deviceof claim 14 wherein the feedback loop is a second order feedback loop.18. The implantable device of claim 14 wherein the control unit isfurther configured to determine an estimate P′ of a slope P of a currentECAP growth curve.
 19. The implantable device of claim 18 wherein thecontrol unit is configured to produce the estimate P′ from an empiricalrelationship of stimulus current to measured ECAP amplitude.
 20. Theimplantable device of claim 18 wherein the control unit is furtherconfigured to estimate P′ as P′=(V+K)/I, where V is ECAP amplitude, K isa constant or function which relates P to a stimulus threshold T, and Iis stimulus current amplitude.